-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Networking: added CAN multicast UDP network gateway #28038
Conversation
a1db65e
to
071e1dc
Compare
You had me at update FW.... |
If I run this "behind" a Raspberry PI on the plane - so not exposing the IP address of the device directly (e.g. I use a proxy to forward the web server and mavp2p to forward the mavlink traffic over a different interface), how would I forward the CAN traffic? |
the multicast traffic can be fwded over the link if your IP radio allows that. I'm thinking we may need to have an option to set the TTL to 1 so it doesn't get fwded note you can use the existing network port fwding to fwd mavlink and then use mavcan |
Setting up CAN on companion computers is hard. This is a nice alternative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read through the PR, really neat Tridge! Just some ideas, largely NFC.
I tried to find spots for nullptr dereference and it looks good.
@bugobliterator is reviewing this - hopefully done soon! |
this allows the CAN interface to operate without a CAN cable, allowing for bridging of MCAST UDP CAN
this allows for CAN MCAST and MAVCAN at the same time
this allows for operation of CAN interfaces over UDP multicast networking
allows for fw update of network peripheral devices
071e1dc
to
5bdf9bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, except for minor change request to thread_sleep_us. That could be a future trap if someone tries to run an odd conversion frequency between ticks and seconds.
This is the PR that caused the issues with DroneCAN over MAVLink described in #28175 |
This allows the PPPGW peripherals to act as CAN multicast gateways, which allows any device on the ethernet network to interact with CAN devices on the flight controllers CAN networks
It also means we can configure and update the PPPGW peripherals without knowing the IP address it is configured for, as we can use DroneCAN GUI tool with interface mcast:0 or mcast:1 to get at CAN1 or CAN2 and configure parameters
This gateway is enabled in both AP_Periph with PPPGW and in the network enabled AP_Periph bootloader, which means this can also be used to update the firmware on the AP_Periph PPPGW device
This costs about 450 bytes, which comes from the change to the hal.can API to allow registration of more than one callback. We could have a new API that only appears when this option is enabled, but it would be a duplicate of the current register function, just with a new cb targets, maybe cb_mcast.